﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buyerModulusEdit.aspx.cs"
    Inherits="PeisongWeb.admin.buyerModulusEdit" %>

<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>采购商价格系数设置 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script src="../app_common/scripts/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="../app_common/scripts/QueryString.js" type="text/javascript"></script>

    <script src="scripts/modulusEdit.js?8.1" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:ScriptManager ID="ResourceManager1" runat="server" OnAsyncPostBackError="ResourceManager1_AsyncPostBackError" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <p>
        &nbsp;&nbsp;</p>
    <div id="admin_main" style="margin: 10px 0 0 10px;">
        <ext:TabPanel runat="server" Width="950" ID="companyTab" ActiveTabIndex="2">
            <Tabs>
                <ext:Tab ID="ACTOCompany" runat="server" AutoHeight="true" Title="按企业设置" Frame="true" Enabled="false">
                    <Body>
                        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                            <ContentTemplate>
                                <ext:Panel ID="Panel1" runat="server" Title="查询搜索" BodyStyle="padding:5px 5px 0"
                                    Width="930px" Frame="true" ButtonAlign="Center">
                                    <Body>
                                        <div id="admin_edit_content_search" style="width: 930px;">
                                            <ul>
                                                <li style="width: auto; margin-right: 20px;">
                                                    <label style="width: 85px;">
                                                        企业名称：</label>
                                                    <asp:DropDownList runat="server" ID="ddlCompany" DataTextField="company" DataValueField="companyId"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width: auto; margin-right: 20px;">
                                                    <label style="width: 85px;">
                                                        大类：</label>
                                                    <asp:DropDownList runat="server" ID="ddlRootCategory" DataTextField="name" DataValueField="categoryId"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ddlRootCategory_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width: auto; margin-right: 20px;">
                                                    <label style="width: 85px;">
                                                        小类：</label>
                                                    <asp:DropDownList runat="server" ID="ddlSubCategory" DataTextField="name" DataValueField="categoryId"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ddlSubCategory_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width: auto; margin-right: 20px">
                                                    <label>
                                                        商品名称
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txtProductName" Width="85px"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 20px">
                                                    <label>
                                                        商品编号
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txtProductNo" Width="85px"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 10px;">[<asp:LinkButton runat="server" ID="btnSearch"
                                                    Text="搜索" OnClick="btnSearch_Click"></asp:LinkButton>]&nbsp;&nbsp;<a href="javascript:void(0);"
                                                        onclick="resetFields();">[重置]</a></li>
                                            </ul>
                                        </div>
                                    </Body>
                                </ext:Panel>
                                <p>
                                    &nbsp;&nbsp;</p>
                                <div id="admin_list_content" style="width: 930px;">
                                    <table cellpadding="0" cellspacing="0">
                                        <tr class="header-row">
                                            <th width="10%">
                                                商品编号
                                            </th>
                                            <th width="25%">
                                                商品名称
                                            </th>
                                            <th width="15%">
                                                当前系统加价
                                            </th>
                                            <th width="10%" style="<%=hasPermission("CF",2)?"":"display:none;" %>">
                                                系统加价
                                            </th>
                                            <th width="15%">
                                                当前企业加价
                                            </th>
                                            <th width="10%" style="<%=hasPermission("FE",2)?"":"display:none;" %>">
                                                企业加价
                                            </th>
                                            <th width="15%">
                                                操作
                                            </th>
                                        </tr>
                                        <asp:Repeater runat="server" ID="rpt_list">
                                            <ItemTemplate>
                                                <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                                    <td>
                                                        <%#DataBinder.Eval(Container.DataItem,"productNo") %>
                                                    </td>
                                                    <td>
                                                        <%#DataBinder.Eval(Container.DataItem,"productName") %>
                                                    </td>
                                                    <td style="color: Green;">
                                                        <%#DataBinder.Eval(Container.DataItem,"productAutoAdd","{0:F3}") %>
                                                    </td>
                                                    <td style="<%=hasPermission("CF",2)?"":"display:none;" %>">
                                                        <input type="text" onblur="filterFormat(this);" class="RedPriceTextBox" maxlength="8"
                                                            size="10" initvalue="<%#DataBinder.Eval(Container.DataItem,"productAutoAdd","{0:F3}") %>" />
                                                    </td>
                                                    <td style="color: Red;">
                                                        <%#DataBinder.Eval(Container.DataItem, "autoPercent", "{0:F3}")%>
                                                    </td>
                                                    <td style="<%=hasPermission("FE",2)?"":"display:none;" %>">
                                                        <input type="text" onblur="filterFormat(this);" class="GreenPriceTextBox" maxlength="8"
                                                            size="10" initvalue="<%#DataBinder.Eval(Container.DataItem, "autoPercent", "{0:F3}")%>" />
                                                    </td>
                                                    <td>
                                                        <input type="button" value="保存" onclick="return adminSubmitPriceActor(this,<%#DataBinder.Eval(Container.DataItem,"productId") %>,<%=companyId %>);" />
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </table>
                                    <div id="page">
                                        <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                                            OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                                            InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                                            ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                            CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                                            LastPageText="末页" PrevPageText="上一页">
                                        </webdiyer:AspNetPager>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </Body>
                </ext:Tab>
                <ext:Tab ID="ACTOCategory" runat="server" AutoHeight="true" Title="按商品类别设置企业加价" Frame="true" Enabled="false">
                    <Body>
                        <asp:UpdatePanel runat="server" ID="UpdatePanel2">
                            <Triggers>
                                <asp:PostBackTrigger ControlID="btn_PriceStructureSave" />
                                <asp:PostBackTrigger ControlID="linkExport" />
                            </Triggers>
                            <ContentTemplate>
                                <ext:Panel ID="Panel2" runat="server" Title="查询搜索" BodyStyle="padding:5px 5px 0"
                                    Width="930px" Frame="true" ButtonAlign="Center">
                                    <Body>
                                        <div id="admin_edit_content_search" style="width: 930px;">
                                            <ul>
                                                <li style="width: auto; margin-right: 10px;">
                                                    <label style="width: 85px;">企业名称：</label>
                                                    <asp:DropDownList runat="server" ID="ddlCompany2" DataTextField="company" 
                                                        DataValueField="companyId" AutoPostBack="True" 
                                                        OnSelectedIndexChanged="ddlCompany2_SelectedIndexChanged" style="height: 22px">
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width: auto; margin-right:205px;">
                                                    <label>&nbsp;&nbsp;</label>
                                                    [<asp:LinkButton runat="server" ID="linkSearch2" Text="搜索" OnClick="linkSearch2_Click"></asp:LinkButton>]
                                                </li>
                                                <li style="width: auto;">
                                                    <label>&nbsp;&nbsp;</label>
                                                    [<asp:LinkButton runat="server" ID="linkExport" Text="导出Excel" onclick="linkExport_Click"></asp:LinkButton>]
                                                </li>
                                            </ul>
                                        </div>
                                    </Body>
                                </ext:Panel>
                                <p>&nbsp;&nbsp;</p>
                                <div id="admin_edit_content" style="width: 930px;">
                                    <ul>
                                        <asp:Repeater runat="server" ID="rptPriceStructure">
                                            <ItemTemplate>
                                                <li class="priceStructureTips" style="<%#DataBinder.Eval(Container.DataItem,"parentId").ToString()=="0"?"": "display:none" %>">
                                                <label style="width: 150px;"><div style="margin-left: 20px;"><%#DataBinder.Eval(Container.DataItem,"name")%></div></label>
                                                <span class="priceStructureTipsSpan">加价比例</span>
                                            </li>
                                            <li style="<%#Container.ItemIndex%2==0?"background-color:White;": "" %><%#Eval("parentId").ToString()=="0"?"display:none":"" %>">
                                                <label style="width: 150px;"><div style="margin-left: 20px;"><%#DataBinder.Eval(Container.DataItem,"name")%></div></label>
                                                <input onblur='checkNum(this);' onafterpaste='checkNum(this);' style='text-align: right;width: 20px;' maxlength='3' id='input_percent<%#Eval("parentId").ToString()=="0"?"0":"" %>_<%#Eval("categoryId")%>' type='text' value='<%# Convert.ToDouble(Eval("currentPercent"))*100%>'>%
                                            </li>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                        <li>
                                            <label style="width: 150px;">
                                                &nbsp;
                                            </label>
                                            <span style="<%=power>=2?"": "display:none" %>">
                                                <asp:Button ID="btn_PriceStructureSave" runat="server" OnClientClick="return getPriceStructure();" Text="保存" OnClick="btn_PriceStructureSave_Click" />
                                            </span>
                                            <input type="button" value="返回" onclick="javascript:window.location.href='companyList.aspx';" />
                                            <input type="hidden" runat="server" id="hd_pricePercent" />
                                        </li>
                                    </ul>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </Body>
                </ext:Tab>
                <ext:Tab ID="ACTOProduct" runat="server" AutoHeight="true" Title="按商品设置系统加价" Frame="true" Enabled="false" Visible="false">
                    <Body>
                        <asp:UpdatePanel runat="server" ID="UpdatePanel3">
                            <ContentTemplate>
                                <ext:Panel ID="Panel3" runat="server" Title="查询搜索" BodyStyle="padding:5px 5px 0"
                                    Width="930px" Frame="true" ButtonAlign="Center">
                                    <Body>
                                        <div id="admin_edit_content_search" style="width: 930px;">
                                            <ul>
                                                <li style="width:85px; margin-right: 0px">
                                                    <asp:DropDownList runat="server" ID="ddlWhereClause3">
                                                        <asp:ListItem Value="1">商品名称</asp:ListItem>
                                                        <asp:ListItem Value="2">商品编号</asp:ListItem>
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width:255px; margin-right: 20px">
                                                    <asp:TextBox runat="server" ID="txtFiledValue" Width="155px"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 10px;">[<asp:LinkButton runat="server" ID="linkSearch3" Text="搜索" OnClientClick="return linkSearch3_Validate();" OnClick="linkSearch3_Click"></asp:LinkButton>]&nbsp;&nbsp;<a href="javascript:void(0);" onclick="resetFields3();">[重置]</a></li>
                                            </ul>
                                        </div>
                                        <p>&nbsp;&nbsp;</p>
                                        <div id="admin_list_content" style="width: 930px;">
                                            <asp:Panel runat="server" ID="panel11" Visible="false">
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr class="header-row">
                                                        <th width="50%">
                                                            商品名称
                                                        </th>
                                                        <th width="50%">
                                                            操作
                                                        </th>
                                                    </tr>
                                                    <asp:Repeater runat="server" ID="rptMutiProducts" OnItemCommand="rptMutiProducts_Command">
                                                        <ItemTemplate>
                                                            <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                                                <td>
                                                                    <%#DataBinder.Eval(Container.DataItem,"productName") %>
                                                                </td>
                                                                <td>
                                                                    <asp:LinkButton runat="server" ID="link3Choose" CommandName="Choose" CommandArgument='<%#String.Format("{0},{1}",DataBinder.Eval(Container.DataItem,"productId"),DataBinder.Eval(Container.DataItem,"productName")) %>'>选择</asp:LinkButton>
                                                                </td>
                                                            </tr>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </table>
                                            </asp:Panel>
                                            <asp:Panel runat="server" ID="panel12" Visible="false">
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr class="header-row">
                                                        <th>
                                                            商品名称
                                                        </th>
                                                        <th>
                                                            商品系统加价
                                                        </th>
                                                        <th>
                                                        </th>
                                                        <th>操作</th>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Literal runat="server" ID="lbl3ProductName"></asp:Literal>
                                                        </td>
                                                        <td style="color:Green;">
                                                            <asp:Literal runat="server" ID="lbl3ProductAutoAdd"></asp:Literal>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server" ID="txt3ProductAutoAdd" CssClass="GreenPriceTextBox" MaxLength="8" onblur='checkNum(this);' onafterpaste='checkNum(this);'></asp:TextBox>
                                                        </td>
                                                        <td>
                                                            <asp:Button runat="server" ID="btn3_Save_ProductAutoAdd" Text="保存" OnClientClick="return client_Save_ProductAutoAdd();" onclick="btn3_Save_ProductAutoAdd_Click" />
                                                        </td>
                                                    </tr>
                                                    <tr class="alt">
                                                        <td colspan="2"><asp:HiddenField runat="server" ID="hdCurProductId" /><asp:HiddenField runat="server" ID="hdCurProductAutoAdd" /></td>
                                                        <td><asp:CheckBox runat="server" ID="chkApplyAllCompany" />应用到所有企业</td>
                                                        <td></td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        </div>
                                    </Body>
                                </ext:Panel>
                            </ContentTemplate>
                            <Triggers>
                                <asp:PostBackTrigger ControlID="btn3_Save_ProductAutoAdd" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </Body>
                </ext:Tab>
            </Tabs>
        </ext:TabPanel>
    </div>
    </form>
</body>
</html>
